<?PHP //-*-coding: utf-8;-*-

/* 初始化设置 */
@ini_set('memory_limit',          '256M');
@ini_set('session.cache_expire',  180);
@ini_set('session.use_cookies',   1);
@ini_set('session.auto_start',    0);
@ini_set('display_errors',        1);
@ini_set("arg_separator.output","&amp;");

date_default_timezone_set("Asia/Chongqing");

error_reporting(E_ALL ^ E_NOTICE);
//error_reporting( 0 );

// 要求定义好 _PATH_ 和 SCRIPT_NAME ，及定义 DS 为路径分隔符
if (!defined('DS'))				{ die("Error : (".realpath(__FILE__).") not defined 'DS' "); }
if (!defined('ROOT_PATH'))		{ die("Error : (".realpath(__FILE__).") not defined 'ROOT_PATH' "); }
if (!defined('SCRIPT_NAME'))	{ die("Error : (".realpath(__FILE__).") not defined 'SCRIPT_NAME' "); }

/* Set the include path. */

define("CONTROLLERS_PATH", ROOT_PATH.'controllers'.DS);
define("INCLUDE_PATH", ROOT_PATH.'include'.DS);
define("VENDORS_PATH", ROOT_PATH.'vendors'.DS);
define("MODELS_PATH", ROOT_PATH.'models'.DS);
define("DATA_PATH", ROOT_PATH.'data'.DS);
define("LIB_PATH", ROOT_PATH.'lib'.DS);
define('LANG_PATH',ROOT_PATH.'lan'.DS);
define('EXEC_PATH',ROOT_PATH.'exec'.DS);

// 函数
require (INCLUDE_PATH . 'functions.php');

/* Include $cout Array */
require (INCLUDE_PATH . 'config.cout.php');

/* Include MySQL CONFIG File */
require (INCLUDE_PATH . 'config.db.php');

/* Include Smarty CONFIG File */
require (INCLUDE_PATH . 'config.tpl.php');

/* Include Ucenter CONFIG File */
//require (INCLUDE_PATH . 'config.ucenter.php');

/* Include Mail CONFIG File */
//require (INCLUDE_PATH . 'config.mail.php');

/* Include SMS CONFIG File */
require (INCLUDE_PATH . 'config.sms.php');

$tpl = "";

//cache
//require (VENDORS_PATH .'cache'.DS. 'cyMemcache.php');

//$memcached = new cyMemcache($cache_server);


require (VENDORS_PATH .'session'.DS. 'session.php');

require (VENDORS_PATH .'session'.DS. 'drivers'.DS.'session_memcache_driver.php');

$sess = false;
//$sess = new session_memcache_driver(DOMAIN);
//$_SESSION = $sess->start();
session_start();
//分拆当前请求脚本


if (true) //需要加载Smarty的条件
{
	header('Cache-control: private');
	header('Content-type: text/html; charset=utf-8');
 

	/* Create Smarty Object */
	require (VENDORS_PATH . 'smarty'.DS.'Smarty.class.php');
	$tpl = new Smarty;
	$tpl->left_delimiter	=	TPL_LEFT_DELIMITER;
	$tpl->right_delimiter	=	TPL_RIGHT_DELIMITER;
	$tpl->caching			=	TPL_CACHING;
	$tpl->cache_lifetime	=	TPL_CACHE_LIFETIME;
	$tpl->cache_dir			=	TPL_CACHE;
	$tpl->template_dir		=	TPL_TEMPLATE;
	$tpl->compile_dir		=	TPL_COMPILE;
	$tpl->compile_check		=	true;
	//$tpl->register_function("insert_scripts", "insert_scripts");
}
?>